package com.hsc.www.dealLetter;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.concurrent.TimeUnit;

@SpringBootTest(classes = App.class)
@RunWith(SpringJUnit4ClassRunner.class)
public class DealLetter {

    @Autowired
    private UserSender userSender;

    @Test
    public void testRabbit() throws Exception {
        for (int i = 0; i < 10; i++) {
//            userSender.send(Config.DOG_ROUTING_KEY, new User("dog" + i));
        }
        TimeUnit.SECONDS.sleep(10000000);//等待接收
    }
}
//docker run -d --name rabbitmq3.7.7 -p 5672:5672 -p 15672:15672    --hostname myRabbit -e RABBITMQ_DEFAULT_VHOST=my_vhost  -e RABBITMQ_DEFAULT_USER=guest -e RABBITMQ_DEFAULT_PASS=guest df80af9ca0c9